package com.gopay.common.cps.manager.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.gopay.common.cps.dao.solution.CpsAcctProdMastQueryDAO;
import com.gopay.common.cps.manager.CpsAcctProdMastQueryManager;
import com.gopay.common.domain.acps.AcctProd;
import com.gopay.common.domain.cps.CpsAcctProdMast;

import java.util.List;

@Service("cpsAcctProdMastQueryManager")
public class CpsAcctProdMastQueryManagerImpl implements CpsAcctProdMastQueryManager {
    @Resource(name = "cpsAcctProdMastQueryDAO")
    private CpsAcctProdMastQueryDAO cpsAcctProdMastQueryDAO;

    @Override
    public CpsAcctProdMast getAcctProd(AcctProd prodCode) {
        return cpsAcctProdMastQueryDAO.find(CpsAcctProdMast.class, prodCode.toString());
    }

    public CpsAcctProdMastQueryDAO getCpsAcctProdMastQueryDAO() {
        return cpsAcctProdMastQueryDAO;
    }

    public void setCpsAcctProdMastQueryDAO(CpsAcctProdMastQueryDAO cpsAcctProdMastQueryDAO) {
        this.cpsAcctProdMastQueryDAO = cpsAcctProdMastQueryDAO;
    }

    @Override
    public List<CpsAcctProdMast> getAll() {
        return cpsAcctProdMastQueryDAO.findAll(CpsAcctProdMast.class);
    }

}
